<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>更新广告</title>
<%@include file="../common/manageLink.jsp"%>
<script type="text/javascript">
function updatePic(){
	if($("#uPB").val()=="修改商品分类图片"){
		$("#catePicDiv").append("<input class=\"form-control\" name=\"adPicFile\" id=\"adPicFile\" type=\"file\"  required/>");
		$("#uPB").val("取消修改商品分类图片");
	}
	else{
		$("#catePicDiv").children("#catePicFile").remove();
		$("#uPB").val("修改商品分类图片");
	}
	
}
</script>
</head>
<body>
<%@include file="../common/managerHeader.jsp"%>
<div class="container-fluid-full">
    <div class="row-fluid">

        <%@include file="../common/managerLeft.jsp"%>
        <!-- start: Content -->
        <div id="content" class="span10">


            <ul class="breadcrumb">
                <li>
                    <i class="icon-home"></i>
                    <a href="index.html">主页</a>
                    <i class="icon-angle-right"></i>
                </li>
                <li><a href="#">广告管理</a></li>
            </ul>

            <div class="row-fluid sortable">
                <div class="box span12">
                    <div class="box-header" data-original-title>
                        <h2><i class="halflings-icon white edit"></i><span class="break"></span>更新广告</h2>
                        <div class="box-icon">
                            <a href="#" class="btn-setting"><i class="halflings-icon white wrench"></i></a>
                            <a href="#" class="btn-minimize"><i class="halflings-icon white chevron-up"></i></a>
                            <a href="#" class="btn-close"><i class="halflings-icon white remove"></i></a>
                        </div>
                    </div>
                    <div class="box-content">
                        <form class="form-horizontal" action="${pageContext.request.contextPath}/admanage/managerupdatead" method="post" enctype="multipart/form-data">
                            <c:if test="${!empty adver }">
                            <fieldset>
                                <div class="control-group">
                                    <label class="control-label" for="disabledInput">广告ID</label>
                                    <div class="controls">
                                        <input class="input-xlarge disabled" name="adId" value="${adver.adId }" type="text" placeholder="自动填写" disabled="">
                                        <input type="hidden" id="adId" name="adId" value="${adver.adId }">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label" for="">广告标题</label>
                                    <div class="controls">
                                        <div class="input-append">
                                            <input id="adTitle" name="adTitle" size="16" type="text" value="${adver.adTitle }">
                                        </div>
                                    </div>
                                </div>
                                <div class="control-group hidden-phone">
                                    <label class="control-label" for="textarea2">广告内容</label>
                                    <div class="controls">
                                        <textarea class="cleditor"  name="adMain" rows="3" >${adver.adMain }</textarea>
                                    </div>
                                </div>
                                
                                <div class="control-group">
                                    <label class="control-label" for="textarea2">广告图片</label>
                                    <div class="controls" id="catePicDiv">
                                        
                                        <!-- <input class="form-control" name="adPicFile" id="adPicFile" type="file"  required/> -->
                                        <input type="hidden" name="adPic" value="${adver.adPic}"/>
                                        <input class="form-control btn-info" type="button" id="uPB" value="修改商品分类图片" onclick="updatePic()"/>
                                    </div>
                                    <img src="${pageContext.request.contextPath}${adver.adPic}" width="250" height="200">
                                </div>
                                

                                <div class="form-actions">
                                    <button type="submit" class="btn btn-primary">保存</button>
                                    <button type="reset" class="btn">取消</button>
                                </div>
                            </fieldset>
                            </c:if>
                        </form>

                    </div>
                </div><!--/span-->

            </div><!--/row-->

        </div><!--/.fluid-container-->

        <!-- end: Content -->
    </div><!--/#content.span10-->
</div><!--/fluid-row-->

<div class="clearfix"></div>

<footer>

    <p>
        <span style="text-align:left;float:left">&copy; 2013 <a href="downloads/janux-free-responsive-admin-dashboard-template/" alt="Bootstrap_Metro_Dashboard">JANUX Responsive Dashboard</a></span>

    </p>

</footer>



</body>
</html>
